var patternSum = {
    "2l28": "DEVIL",
    "1l28": "DEVIL",
    "9l10": "EMPEROR",
    "1l20": "NINELORD",
    "2l20": "NINELORD",
    "20l20": "PAIRSKY",
    "21l21": "PAIRLAND",
    "22l22": "PAIRRED",
    "23l23": "PAIRGOOSE",
    "24l24": "PAIRBIGFIVE",
    "26l26": "PAIRLONGTHREE",
    "27l27": "PAIRTWO",
    "28l28": "PAIRTIGER",
    "29l29": "PAIRGOLD",
    "30l30": "PAIR1SIX",
    "31l31": "PAIR1FIVE",
    "1l2": "PAIRNINE",
    "3l4": "PAIREIGHT",
    "5l6": "PAIRSEVEN",
    "7l8": "PAIRFIVE",
    "20l22": "SKYGANG",
    "3l20": "SKYGANG",
    "4l20": "SKYGANG",
    "2l21": "LANDGANG",
    "3l21": "LANDGANG",
    "21l22": "LANDGANG",
    "6l20": "SKYNINE",
    "5l20": "SKYNINE",
    "20l30": "SKYNINE",
    "6l21": "LANDNINE",
    "5l21": "LANDNINE",
    "21l30": "LANDNINE",
    "22l28": "HUMANNINE",
    "8l23": "GOOSENINE",
    "7l23": "GOOSENINE",
    "8l27": "LANGCARDNINE",
    "1l24": "LANGCARDNINE",
    "7l27": "LANGCARDNINE",
    "2l24": "LANGCARDNINE",
    "10l26": "LANGCARDNINE",
    "3l28": "SHORTCARDNINE",
    "1l29": "SHORTCARDNINE",
    "4l28": "SHORTCARDNINE",
    "2l29": "SHORTCARDNINE",
    "10l31": "SHORTCARDNINE",
    "20l31": "SKYEIGHT",
    "20l26": "SKYEIGHT",
    "9l20": "SKYEIGHT",
    "21l31": "LANDEIGHT",
    "21l26": "LANDEIGHT",
    "9l21": "LANDEIGHT",
    "22l24": "HUMANEIGHT",
    "22l29": "HUMANEIGHT",
    "23l27": "GOOSEEIGHT",
    "5l24": "LONGCARDEIGHT",
    "4l24": "LONGCARDEIGHT",
    "4l29": "SHORTCARDEIGHT",
    "3l29": "SHORTCARDEIGHT",
    "28l30": "SHORTCARDEIGHT",
    "5l28": "SHORTCARDEIGHT",
    "6l28": "SHORTCARDEIGHT",
    "7l10": "POINTEIGHT",
    "8l10": "POINTEIGHT",
    "7l20": "SKYSEVEN",
    "8l20": "SKYSEVEN",
    "7l21": "LANDSEVEN",
    "8l21": "LANDSEVEN",
    "2l22": "HUMANSEVEN",
    "1l22": "HUMANSEVEN",
    "10l23": "GOOSESEVEN",
    "6l24": "LONGCARDSEVEN",
    "24l30": "LONGCARDSEVEN",
    "26l28": "LONGCARDSEVEN",
    "10l27": "LONGCARDSEVEN",
    "5l24": "LONGCARDSEVEN",
    "28l31": "SHORTCARDSEVEN",
    "5l29": "SHORTCARDSEVEN",
    "6l29": "SHORTCARDSEVEN",
    "29l31": "SHORTCARDSEVEN",
    "9l28": "SHORTCARDSEVEN",
    "1l4": "POINTSEVEN",
    "2l3": "POINTSEVEN",
    "1l3": "POINTSEVEN",
    "2l4": "POINTSEVEN",
    "20l27": "SKYSIX",
    "20l23": "SKYSIX",
    "21l23": "LANDSIX",
    "21l27": "LANDSIX",
    "4l22": "HUMANSIX",
    "3l22": "HUMANSIX",
    "24l26": "LONGCARDSIX",
    "24l31": "LONGCARDSIX",
    "9l28": "LONGCARDSIX",
    "26l29": "LONGCARDSIX",
    "9l29": "SHORTCARDSIX",
    "29l31": "SHORTCARDSIX",
    "8l28": "SHORTCARDSIX",
    "7l28": "SHORTCARDSIX",
    "2l30": "SHORTCARDSIX",
    "1l30": "SHORTCARDSIX",
    "2l6": "POINTSIX",
    "1l6": "POINTSIX",
    "2l5": "POINTSIX",
    "10l20": "SKYFIVE",
    "10l21": "LANDFIVE",
    "6l22": "HUMANFIVE",
    "22l30": "HUMANFIVE",
    "5l22": "HUMANFIVE",
    "23l28": "GOOSEFIVE",
    "8l24": "LONGCARDFIVE",
    "2l26": "LONGCARDFIVE",
    "27l28": "LONGCARDFIVE",
    "1l26": "LONGCARDFIVE",
    "7l24": "LONGCARDFIVE",
    "2l31": "SHORTCARDFIVE",
    "4l30": "SHORTCARDFIVE",
    "8l29": "SHORTCARDFIVE",
    "1l31": "SHORTCARDFIVE",
    "3l30": "SHORTCARDFIVE",
    "7l29": "SHORTCARDFIVE",
    "3l6": "POINTFIVE",
    "4l5": "POINTFIVE",
    "9l29": "POINTFIVE",
    "2l9": "POINTFIVE",
    "4l6": "POINTFIVE",
    "3l5": "POINTFIVE",
    "20l21": "SKYFOUR",
    "22l31": "HUMANFOUR",
    "9l22": "HUMANFOUR",
    "22l26": "HUMANFOUR",
    "23l24": "GOOSEFOUR",
    "23l29": "GOOSEFOUR",
    "24l27": "LONGCARDFOUR",
    "27l29": "LONGCARDFOUR",
    "3l26": "LONGCARDFOUR",
    "4l26": "LONGCARDFOUR",
    "3l31": "SHORTCARDFOUR",
    "6l30": "SHORTCARDFOUR",
    "4l31": "SHORTCARDFOUR",
    "5l30": "SHORTCARDFOUR",
    "10l28": "SHORTCARDFOUR",
    "3l9": "POINTFOUR",
    "2l8": "POINTFOUR",
    "4l9": "POINTFOUR",
    "1l8": "POINTFOUR",
    "1l7": "POINTFOUR",
    "2l7": "POINTFOUR",
    "20l28": "SKYTHREE",
    "21l28": "LANDTHREE",
    "8l22": "HUMANTHREE",
    "7l22": "HUMANTHREE",
    "2l23": "GOOSETHREE",
    "1l23": "GOOSETHREE",
    "10l24": "LONGCARDTHREE",
    "2l27": "LONGCARDTHREE",
    "6l26": "LONGCARDTHREE",
    "26l30": "LONGCARDTHREE",
    "1l27": "LONGCARDTHREE",
    "5l26": "LONGCARDTHREE",
    "10l29": "SHORTCARDTHREE",
    "30l31": "SHORTCARDTHREE",
    "9l30": "SHORTCARDTHREE",
    "6l31": "SHORTCARDTHREE",
    "5l31": "SHORTCARDTHREE",
    "6l9": "POINTTHREE",
    "4l8": "POINTTHREE",
    "5l9": "POINTTHREE",
    "3l7": "POINTTHREE",
    "4l7": "POINTTHREE",
    "3l8": "POINTTHREE",
    "20l24": "SKYTWO",
    "20l29": "SKYTWO",
    "21l29": "LANDTWO",
    "21l24": "LANDTWO",
    "22l27": "HUMANTWO",
    "22l23": "HUMANTWO",
    "4l23": "GOOSETWO",
    "3l23": "GOOSETWO",
    "9l26": "LONGCARDTWO",
    "26l31": "LONGCARDTWO",
    "3l27": "LONGCARDTWO",
    "4l27": "LONGCARDTWO",
    "8l30": "SHORTCARDTWO",
    "9l31": "SHORTCARDTWO",
    "7l30": "SHORTCARDTWO",
    "2l10": "POINTTWO",
    "6l8": "POINTTWO",
    "6l7": "POINTTWO",
    "5l8": "POINTTWO",
    "1l10": "POINTTWO",
    "5l7": "POINTTWO",
    "2l21": "LANDONE",
    "1l21": "LANDONE",
    "10l22": "HUMANONE",
    "23l30": "GOOSEONE",
    "5l23": "GOOSEONE",
    "6l23": "GOOSEONE",
    "24l28": "LONGCARDONE",
    "27l30": "LONGCARDONE",
    "8l26": "LONGCARDONE",
    "5l27": "LONGCARDONE",
    "6l27": "LONGCARDONE",
    "7l27": "LONGCARDONE",
    "28l29": "SHORTCARDONE",
    "7l31": "SHORTCARDONE",
    "8l31": "SHORTCARDONE",
    "7l9": "POINTONE",
    "8l9": "POINTONE",
    "4l10": "POINTONE",
    "3l10": "POINTONE",
    "24l29": "BITEN",
    "10l30": "BITEN",
    "26l27": "BITEN",
    "9l23": "BITEN",
    "27l31": "BITEN",
    "6l10": "BITEN",
    "23l26": "BITEN",
    "23l31": "BITEN",
    "9l27": "BITEN",
    "5l10": "BITEN",
}

var PairCards = {
    "SKY": 20, // 天牌
    "LAND": 21,     // 地牌
    "HUMAN": 22,    // 人牌
    "GOOSE": 23,    // 鹅牌
    "CLUB": 24,     // 梅花
    "THREE": 26,    // 长三
    "BENCH": 27,    // 板凳
    "TIGER": 28,    // 斧头
    "REDHEAD": 29,  // 红头
    "MESIX": 30,    // 高脚七
    "MEFIVE": 31    // 零霖六
}

var SingleCards = {
    "LEFTNINE" : 1, //九点
    "RIGHTNINE":2,    //九点
    "LEFTEIGHT":3,    //八点
    "RIGHTEIGHT":4,   //八点
    "LEFTSEVEN":5,    //七点
    "RIGHTSEVEN":6,   //七点
    "LEFTFIVE":7,     //五点
    "RIGHTFIVE":8,    //五点
    "BIGSIX":9,       //二四
    "METHREE":10       //丁三
}
var Pattern = {
    "DEVIL":1,  //鬼子 [2,28][28,1]
    "EMPEROR":2,  //皇上 [9,10]
    "NINELORD":3, //九王爷[20,1] [20,2]
    "PAIRSKY":4,  //对天  [20,20]
    "PAIRLAND":5, //对地幺[21,21] 
    "PAIRRED":6,  //对红人[22,22]
    "PAIRGOOSE":7,//对幺鹅 [23,23]

    "PAIRBIGFIVE":8,//对大五[24,24]
    "PAIRLONGTHREE":9,//对长三[26,26]
    "PAIRTWO":10,     //对二板[27,27]

    "PAIRTIGER":11,   //对虎头[28,28]
    "PAIRGOLD":12,    //对金平[29,29]
    "PAIR1SIX":13,    //对幺六[30,30]

    "PAIR1FIVE":14,   //对幺五[31,31]
    "PAIRNINE":15,    //对九[1,2]
    "PAIREIGHT":16,   //对八[3,4]
    "PAIRSEVEN":17,   //对七[5,6]
    "PAIRFIVE":18,    //对五[7,8]
    "SKYGANG":19,     //天杠[20,22] [20,3][20,4]
    "LANDGANG":20,    //地杠[21,2][21,3][21,22]
    "SKYNINE":21,     //天九[20,6][20,5] [30,20]
    "LANDNINE":22,    //地九 [21,6] [21,5] [21,30]
    "HUMANNINE":23,   //人九 [22,28]
    "GOOSENINE":24,   //鹅九[8,23] [23,7]
    "LANGCARDNINE":25,//长牌九[8,27] [24,1] [27,7] [24,2] [26,10]
    "SHORTCARDNINE":26,//短牌九[28,3] [29,1] [28,4] [29,2] [10,31]
    "SKYEIGHT":27,    //天八 [20,31] [20,26] [20,9]
    "LANDEIGHT":28,    //地八[21,31] [21,26] [21,9]
    "HUMANEIGHT":29,   //人八 [22,24] [22,29]
    "GOOSEEIGHT":30,   //鹅八 [27,23]
    "LONGCARDEIGHT":31,//长牌八[24,5] [24,4]
    "SHORTCARDEIGHT":32,//短牌八[4,29] [29,3] [28,30] [28,5] [28,6]
    "POINTEIGHT":33,    //点子八[7,10] [8,10]
    "SKYSEVEN":34,      //天七[20,7] [20,8]
    "LANDSEVEN":35,     //地七[21,7] [21,8]
    "HUMANSEVEN":36,    //人七[2,22] [22,1]
    "GOOSESEVEN":37,    //鹅七[23,10]
    "LONGCARDSEVEN":38, //长牌七[24,6] [24,30] [28,26] [10,27] [24,5]
    "SHORTCARDSEVEN":39,//短牌七[28,31] [29,5] [29,6] [29,31] [9,28]
    "POINTSEVEN":40,    //点七[1,4] [3,2] [1,3] [4,2]
    "SKYSIX":41,        //天六 [20,27] [20,23]
    "LANDSIX":42,       //地六[23,21] [21,27]
    "HUMANSIX":43,      //人六[4,22] [3,22]
    "LONGCARDSIX":44,   //长牌六[24,26] [24,31] [28,9] [29,26]
    "SHORTCARDSIX":45,  //短牌六[29,9] [29,31] [28,8] [28,7] [2,30] [1,30]
    "POINTSIX":46,      //点六[6,2] [1,6] [5,2]
    "SKYFIVE":47,       //天五[20,10]
    "LANDFIVE":48,      //地五[21,10]
    "HUMANFIVE":49,     //人五[22,6] [22,30] [22,5]
    "GOOSEFIVE":50,     //鹅五 [28,23]
    "LONGCARDFIVE":51,  //长牌五[8,24] [2,26] [27,28] [1,26] [24,7]
    "SHORTCARDFIVE":52, //短牌五[31,2] [30,4] [29,8] [1,31] [30,3] [29,7]
    "POINTFIVE":53,     //点五[6,3] [4,5] [9,29] [9,2] [6,4] [3,5]
    "SKYFOUR":54,       //天四[20,21]
    "HUMANFOUR":55,     //人四[22,31] [22,9] [22,26]
    "GOOSEFOUR":56,     //鹅四[23,24] [23,29]
    "LONGCARDFOUR":57,  //长牌四[27,24] [27,29] [26,3] [26,4]
    "SHORTCARDFOUR":58, //短牌四[3,31] [6,30] [4,31] [5,30] [10,28]
    "POINTFOUR":59,     //点四[3,9] [8,2] [9,4] [8,1] [7,1] [7,2]
    "SKYTHREE":60,      //天三 [20,28]
    "LANDTHREE":61,     //地三[21,28]
    "HUMANTHREE":62,    //人三[22,8] [22,7]
    "GOOSETHREE":63,    //鹅三[2,23] [23,1]
    "LONGCARDTHREE":64, //长牌三[10,24] [27,2] [6,26] [30,26] [1,27] [26,5]
    "SHORTCARDTHREE":65,//短牌三[10,29] [31,30] [30,9] [6,31] [31,5]
    "POINTTHREE":66,    //点三[6,9] [4,8] [9,5] [3,7] [7,4] [8,3]
    "SKYTWO":67,        //天二[24,20] [20,29]
    "LANDTWO":68,       //地二 [21,29] [21,24]
    "HUMANTWO":69,      //人二[22,27] [22,23]
    "GOOSETWO":70,      //鹅二[23,4] [23,3]
    "LONGCARDTWO":71,   //长牌二[9,26] [31,26] [27,3] [27,4]
    "SHORTCARDTWO":72,  //短牌二[8,30] [9,31] [30,7]
    "POINTTWO":73,      //点二[10,2] [8,6] [7,6] [8,5] [10,1] [7,5]
    "SKYONE":74,
    "LANDONE":75,       //地一[21,2] [21,1]
    "HUMANONE":76,      //人一[22,10]
    "GOOSEONE":77,      //鹅一[23,30] [23,5] [23,6]
    "LONGCARDONE":78,   //长一 [28,24] [27,30] [8,26] [27,5] [27,6] [26,7]
    "SHORTCARDONE":79,  //短一[29,28] [7,31] [8,31]
    "POINTONE":80,      //点一[9,7] [9,8] [4,10] [3,10]
    "BITEN":81,         //毕十[29,24] [30,10] [27,26] [23,9] [31,27] [6,10] [23,26] [23,31] [27,9] [10,5]
}


var ComparePattern = {
    "DEVIL":1,  //鬼子 [2,28][28,1]
    "EMPEROR":2,  //皇上 [9,10]
    "NINELORD":3, //九王爷[20,1] [20,2]
    "PAIRSKY":4,  //对天  [20,20]
    "PAIRLAND":5, //对地幺[21,21] 
    "PAIRRED":6,  //对红人[22,22]
    "PAIRGOOSE":7,//对幺鹅 [23,23]

    "PAIRBIGFIVE":8,//对大五[24,24]
    "PAIRLONGTHREE":8,//对长三[26,26]
    "PAIRTWO":8,     //对二板[27,27]

    "PAIRTIGER":11,   //对虎头[28,28]
    "PAIRGOLD":11,    //对金平[29,29]
    "PAIR1SIX":11,    //对幺六[30,30]

    "PAIR1FIVE":14,   //对幺五[31,31]
    "PAIRNINE":15,    //对九[1,2]
    "PAIREIGHT":16,   //对八[3,4]
    "PAIRSEVEN":17,   //对七[5,6]
    "PAIRFIVE":18,    //对五[7,8]
    "SKYGANG":19,     //天杠[20,22] [20,3][20,4]
    "LANDGANG":20,    //地杠[21,2][21,3][21,22]
    "SKYNINE":21,     //天九[20,6][20,5] [30,20]
    "LANDNINE":22,    //地九 [21,6] [21,5] [21,30]
    "HUMANNINE":23,   //人九 [22,28]
    "GOOSENINE":24,   //鹅九[8,23] [23,7]
    "LANGCARDNINE":25,//长牌九[8,27] [24,1] [27,7] [24,2] [26,10]
    "SHORTCARDNINE":26,//短牌九[28,3] [29,1] [28,4] [29,2] [10,31]
    "SKYEIGHT":27,    //天八 [20,31] [20,26] [20,9]
    "LANDEIGHT":28,    //地八[21,31] [21,26] [21,9]
    "HUMANEIGHT":29,   //人八 [22,24] [22,29]
    "GOOSEEIGHT":30,   //鹅八 [27,23]
    "LONGCARDEIGHT":31,//长牌八[24,5] [24,4]
    "SHORTCARDEIGHT":32,//短牌八[4,29] [29,3] [28,30] [28,5] [28,6]
    "POINTEIGHT":33,    //点子八[7,10] [8,10]
    "SKYSEVEN":34,      //天七[20,7] [20,8]
    "LANDSEVEN":35,     //地七[21,7] [21,8]
    "HUMANSEVEN":36,    //人七[2,22] [22,1]
    "GOOSESEVEN":37,    //鹅七[23,10]
    "LONGCARDSEVEN":38, //长牌七[24,6] [24,30] [28,26] [10,27] [24,5]
    "SHORTCARDSEVEN":39,//短牌七[28,31] [29,5] [29,6] [29,31] [9,28]
    "POINTSEVEN":40,    //点七[1,4] [3,2] [1,3] [4,2]
    "SKYSIX":41,        //天六 [20,27] [20,23]
    "LANDSIX":42,       //地六[23,21] [21,27]
    "HUMANSIX":43,      //人六[4,22] [3,22]
    "LONGCARDSIX":44,   //长牌六[24,26] [24,31] [28,9] [29,26]
    "SHORTCARDSIX":45,  //短牌六[29,9] [29,31] [28,8] [28,7] [2,30] [1,30]
    "POINTSIX":46,      //点六[6,2] [1,6] [5,2]
    "SKYFIVE":47,       //天五[20,10]
    "LANDFIVE":48,      //地五[21,10]
    "HUMANFIVE":49,     //人五[22,6] [22,30] [22,5]
    "GOOSEFIVE":50,     //鹅五 [28,23]
    "LONGCARDFIVE":51,  //长牌五[8,24] [2,26] [27,28] [1,26] [24,7]
    "SHORTCARDFIVE":52, //短牌五[31,2] [30,4] [29,8] [1,31] [30,3] [29,7]
    "POINTFIVE":53,     //点五[6,3] [4,5] [9,29] [9,2] [6,4] [3,5]
    "SKYFOUR":54,       //天四[20,21]
    "HUMANFOUR":55,     //人四[22,31] [22,9] [22,26]
    "GOOSEFOUR":56,     //鹅四[23,24] [23,29]
    "LONGCARDFOUR":57,  //长牌四[27,24] [27,29] [26,3] [26,4]
    "SHORTCARDFOUR":58, //短牌四[3,31] [6,30] [4,31] [5,30] [10,28]
    "POINTFOUR":59,     //点四[3,9] [8,2] [9,4] [8,1] [7,1] [7,2]
    "SKYTHREE":60,      //天三 [20,28]
    "LANDTHREE":61,     //地三[21,28]
    "HUMANTHREE":62,    //人三[22,8] [22,7]
    "GOOSETHREE":63,    //鹅三[2,23] [23,1]
    "LONGCARDTHREE":64, //长牌三[10,24] [27,2] [6,26] [30,26] [1,27] [26,5]
    "SHORTCARDTHREE":65,//短牌三[10,29] [31,30] [30,9] [6,31] [31,5]
    "POINTTHREE":66,    //点三[6,9] [4,8] [9,5] [3,7] [7,4] [8,3]
    "SKYTWO":67,        //天二[24,20] [20,29]
    "LANDTWO":68,       //地二 [21,29] [21,24]
    "HUMANTWO":69,      //人二[22,27] [22,23]
    "GOOSETWO":70,      //鹅二[23,4] [23,3]
    "LONGCARDTWO":71,   //长牌二[9,26] [31,26] [27,3] [27,4]
    "SHORTCARDTWO":72,  //短牌二[8,30] [9,31] [30,7]
    "POINTTWO":73,      //点二[10,2] [8,6] [7,6] [8,5] [10,1] [7,5]
    "LANDONE":74,       //地一[21,2] [21,1]
    "HUMANONE":75,      //人一[22,10]
    "GOOSEONE":76,      //鹅一[23,30] [23,5] [23,6] 
    "LONGCARDONE":77,   //长一 [28,24] [27,30] [8,26] [27,5] [27,6] [26,7]
    "SHORTCARDONE":78,  //短一[29,28] [7,31] [8,31]
    "POINTONE":79,      //点一[9,7] [9,8] [4,10] [3,10]
    "BITEN":80,        
}

module.exports = {
    ComparePattern:ComparePattern,
    Pattern:Pattern,
    PatternSum:patternSum,
    SingleCards:SingleCards,
    PairCards:PairCards
};